package com.neusoft.neuiotms.dcam.common.model;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

@Getter
@Setter
@ToString
@Entity
@org.hibernate.annotations.Table(appliesTo = "neuiot_institutions_user", comment = "单位人员管理表")
@Table(name = "neuiot_institutions_user")
public class DcamInstitutionsUser  extends AbstractModel {
    private static final long serialVersionUID = 1L;

    /** 用户名 */
    @NotBlank(message = "用户名不能为空")
    @Length(max = 50, message = "用户名不能超过{max}位")
    @Column(length = 50, nullable = false, unique = true)
    private String username;

    /** 姓名 */
    @Length(max = 50, message = "姓名不能超过{max}位")
    @Column(length = 50, nullable = true)
    private String name;

    /** 关联单位 */
    @ManyToOne
    private DcamInstitutions institutions;
}
